﻿using System;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace DataEntities
{
    [Table(Name = "dbo.XuZuInfo")]
    public partial class XuZuInfo :Entity
    {
        private int _iXZDId;

        private int _iCZDId;

        private double _dXZJE;

        private DateTime _tOldDate;

        private DateTime _tNewDate;

        private bool _bXZZF;

        private EntityRef<ChuZuInfo> _ChuZuInfo;

        public XuZuInfo()
        {
            this._ChuZuInfo = default(EntityRef<ChuZuInfo>);
        }

        [Column(Storage = "_iXZDId", AutoSync = AutoSync.OnInsert, DbType = "Int NOT NULL IDENTITY", IsPrimaryKey = true, IsDbGenerated = true)]
        public int iXZDId
        {
            get
            {
                return this._iXZDId;
            }
            set
            {
                if ((this._iXZDId != value))
                {
                    this.SendPropertyChanging("iXZDId");
                    this._iXZDId = value;
                    this.SendPropertyChanged("iXZDId",value);
                }
            }
        }

        [Column(Storage = "_iCZDId", DbType = "Int")]
        public int iCZDId
        {
            get
            {
                return this._iCZDId;
            }
            set
            {
                if ((this._iCZDId != value))
                {
                    if (this._ChuZuInfo.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    this.SendPropertyChanging("iCZDId");
                    this._iCZDId = value;
                    this.SendPropertyChanged("iCZDId",value);
                }
            }
        }

        [Column(Storage = "_dXZJE", DbType = "Float")]
        public double dXZJE
        {
            get
            {
                return this._dXZJE;
            }
            set
            {
                if ((this._dXZJE != value))
                {
                    this.SendPropertyChanging("dXZJE");
                    this._dXZJE = value;
                    this.SendPropertyChanged("dXZJE",value);
                }
            }
        }

        [Column(Storage = "_tOldDate", DbType = "DateTime")]
        public DateTime tOldDate
        {
            get
            {
                return this._tOldDate;
            }
            set
            {
                if ((this._tOldDate != value))
                {
                    this.SendPropertyChanging("tOldDate");
                    this._tOldDate = value;
                    this.SendPropertyChanged("tOldDate",value);
                }
            }
        }

        [Column(Storage = "_tNewDate", DbType = "DateTime")]
        public DateTime tNewDate
        {
            get
            {
                return this._tNewDate;
            }
            set
            {
                if ((this._tNewDate != value))
                {
                    this.SendPropertyChanging("tNewDate");
                    this._tNewDate = value;
                    this.SendPropertyChanged("tNewDate",value);
                }
            }
        }

        [Column(Storage = "_bXZZF", DbType = "Bit")]
        public bool bXZZF
        {
            get
            {
                return this._bXZZF;
            }
            set
            {
                if ((this._bXZZF != value))
                {
                    this.SendPropertyChanging("bXZZF");
                    this._bXZZF = value;
                    this.SendPropertyChanged("bXZZF",value);
                }
            }
        }

        [Association(Name = "ChuZuInfo_XuZuInfo", Storage = "_ChuZuInfo", ThisKey = "iCZDId", OtherKey = "iCZDId", IsForeignKey = true)]
        public ChuZuInfo ChuZuInfo
        {
            get
            {
                return this._ChuZuInfo.Entity;
            }
            set
            {
                ChuZuInfo previousValue = this._ChuZuInfo.Entity;
                if (((previousValue != value)
                            || (this._ChuZuInfo.HasLoadedOrAssignedValue == false)))
                {
                    this.SendPropertyChanging("ChuZuInfo");
                    if ((previousValue != null))
                    {
                        this._ChuZuInfo.Entity = null;
                        previousValue.XuZuInfo.Remove(this);
                    }
                    this._ChuZuInfo.Entity = value;
                    if ((value != null))
                    {
                        value.XuZuInfo.Add(this);
                        this._iCZDId = value.iCZDId;
                    }
                    else
                    {
                        this._iCZDId = default(int);
                    }
                    this.SendPropertyChanged("ChuZuInfo",value);
                }
            }
        }
    }
}
